<template>
	<div>
		登录名:<input type="text" v-model="username"><br>
		密码:<input type="text" v-model="password">
		<button @click="goHome">登录</button>
	</div>
</template>

<script>
	export default{
		data(){
			return{
				username:'',
				password:'',
				
			}
		},
		methods:{
			goHome(){
				console.log(1)
				if(this.username =='admin'){
					alert('登录成功')
					localStorage.setItem('token',this.username)
					this.$router.go(-1)
				}
			},
		}
	}
</script>

<style>
</style>
